<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>03_版心和居中</title>
    <style>
        .main{
            background-color: cyan;
        }
        .card{
            width: 300px;
            height: 300px;
            border: 3px solid red;
            background-color: lightgreen;
            text-align: center;
            line-height: 300px;
            margin: 0 auto;
        }
        .center{
            background-color: yellow;
            width: 800px;
            margin: 0 auto;
        }
    </style>
</head>
<body>
    <div class="header">111</div>
    <div class="main">
        <div class="center">
            <div class="card">我是内容</div>
            <div class="card">我是内容</div>
        </div>
    </div>
    <div class="footer">333</div>
</body>
</html>